package com.pet.cloud.order.infrastructure.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pet.cloud.order.infrastructure.entity.PrimaryOrder;
import com.pet.cloud.order.infrastructure.enums.OrderStatus;
import com.pet.cloud.order.infrastructure.mapper.PrimaryOrderMapper;
import com.pet.cloud.order.infrastructure.service.PrimaryOrderService;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class PrimaryOrderServiceImpl extends ServiceImpl<PrimaryOrderMapper, PrimaryOrder> implements PrimaryOrderService {


    @Override
    public void add() {
        PrimaryOrder order = new PrimaryOrder();
        order.setOrderNo(UUID.randomUUID().toString());
        order.setOrderStatus(OrderStatus.PENDING.getCode());
        this.save(order);
    }
}
